<div class="entry-edit">

<div class="content-header">
    <table cellspacing="0" class="grid-header">
        <tr>
            <td><h3><?php echo $this->__('Edit warehouse')?></h3></td>
            <td align="right">
                <button onclick="document.location.href='<?php echo $this->getBackUrl()?>'" class="scalable back" type="button"><span><?php echo $this->__('Back')?></span></button>
                <button onclick="editForm.submit();" class="scalable save" type="button"><span><?php echo $this->__('Save')?></span></button>
            </td>
        </tr>
    </table>
</div>

<form id="edit_form" method="POST" name="edit_form" action="<?php echo $this->getSubmitUrl()?>">
<input id="form_key" name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
<input type="hidden" name="data[stock_id]" name="data[stock_id]" value="<?php echo $this->getStock()->getId(); ?>">
<div class="entry-edit">
    
        <fieldset id="my-fieldset">
            <table cellspacing="0" class="form-list">
                <tr>
                    <td class="label"><?php echo $this->__('Name'); ?></td>
                    <td class="input-ele"><input type="text" name="data[stock_name]" id="data[stock_name]" class="required-entry" value="<?php echo $this->getStock()->getstock_name(); ?>"></td>
                </tr>
                <tr>
                    <td class="label"><?php echo $this->__('Description'); ?></td>
                    <td class="input-ele"><textarea name="data[stock_description]" id="data[stock_description]" cols="50" rows="4"><?php echo $this->getStock()->getstock_description(); ?></textarea></td>
                </tr>
                <tr>
                    <td class="label"><?php echo $this->__('Address'); ?></td>
                    <td class="input-ele"><textarea name="data[stock_address]" id="data[stock_address]" cols="50" rows="4"><?php echo $this->getStock()->getstock_address(); ?></textarea></td>
                </tr>
            </table>
        </fieldset>

</div>

<div class="content-header">
    <table cellspacing="0" class="grid-header">
        <tr>
            <td><h3><?php echo $this->__('Warehouse assignments')?></h3></td>
        </tr>
    </table>
</div>


<div class="grid">
	<fieldset id="my-fieldset">

        <table cellspacing="0" class="data" width="100%">
        	<thead>
        		<tr class="headings">
	        		<th class="a-center"><?php echo $this->__('Website'); ?></th>
	        		<?php foreach ($this->getAssignments() as $assignment): ?>
	        			<th class="a-center"><?php echo $this->__($assignment); ?></th>
	        		<?php endforeach; ?>
	        	</tr>
        	</thead>
        	<tbody>
        		<?php foreach ($this->getWebsites() as $website): ?>
        			<tr>
        				<td><?php echo $website->getName(); ?></td>
		        		<?php foreach ($this->getAssignments() as $assignment): ?>
		        			<td class="a-center"><?php echo $this->getWebsiteAssigmentCombo($website, $assignment); ?></td>
		        		<?php endforeach; ?>        				
        			</tr>
        		<?php endforeach; ?>
        	</tbody>
        </table>
        
	</fieldset>
</div>        

</form>

</div>

<script type="text/javascript"> 
    var editForm = new varienForm('edit_form', '');
</script> 